package com.shuogesha.platform.feign;

import static com.shuogesha.common.web.mongo.SimplePage.cpn;

import java.io.UnsupportedEncodingException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.shuogesha.platform.client.DictionaryCtgFeignClient;
import com.shuogesha.platform.entity.DictionaryCtg;

@RestController
@RequestMapping("/api/dictionaryCtg/")
public class DictionaryCtgFeignAct {
	@RequestMapping(value = "/list")
	public Object v_list(@RequestParam("name") String name, @RequestParam("pageNo") Integer pageNo,
			@RequestParam("pageSize") Integer pageSize) throws UnsupportedEncodingException {
		return dictionaryCtgFeignClient.list(name, cpn(pageNo), pageSize);
	}

	@RequestMapping(value = "/get")
	public Object v_get(Long id) {
		return dictionaryCtgFeignClient.get(id);
	}

	@RequestMapping(value = "/save", method = RequestMethod.POST)
	public Object o_save(@RequestBody DictionaryCtg bean) {

		return dictionaryCtgFeignClient.save(bean);
	}

	@RequestMapping(value = "/update", method = RequestMethod.POST)
	public Object o_update(@RequestBody DictionaryCtg bean) {
		return dictionaryCtgFeignClient.update(bean);
	}

	@RequestMapping(value = "/delete")
	public Object o_delete(Long[] ids) {
		return dictionaryCtgFeignClient.delete(ids);
	}

	@Autowired
	public DictionaryCtgFeignClient dictionaryCtgFeignClient;
}
